package per.sen.shopping.model.dto;

import java.io.Serializable;

import jakarta.validation.constraints.NotBlank;
import jakarta.validation.constraints.Pattern;
import jakarta.validation.constraints.Size;
import lombok.Data;
import per.sen.shopping.infrastructure.common.group.AddGroup;
import per.sen.shopping.infrastructure.common.group.FindGroup;
import per.sen.shopping.infrastructure.common.group.UpdateGroup;

/**
 * @Descibe: 用户登录业务
 * @Author: LYS
 * @Date: 2024/5/30 16:58
 */
@Data
public class SysBackendUserDTO implements Serializable {
    @NotBlank(message = "用户ID不能为空", groups = {UpdateGroup.class})
    private String userId;
    @NotBlank(message = "用户名不能为空", groups = {AddGroup.class,UpdateGroup.class,FindGroup.class})
    @Size(min = 4, max = 32, message = "用户名长度必须在4到32之间", groups = {AddGroup.class,UpdateGroup.class,FindGroup.class})
    private String username;
    @NotBlank(message = "密码不能为空", groups = {AddGroup.class, UpdateGroup.class,FindGroup.class})
    @Size(min = 6, max = 16, message = "密码长度必须在6到16之间",groups = {AddGroup.class,UpdateGroup.class,FindGroup.class})
    private String password;
    @NotBlank(message = "确认密码不能为空", groups = {AddGroup.class,UpdateGroup.class})
    @Size(min = 6, max = 16, message = "密码长度必须在6到16之间",groups = {AddGroup.class,UpdateGroup.class})
    private String enSurePassword;
    @NotBlank(message = "手机号不能为空", groups = {AddGroup.class, UpdateGroup.class})
    @Pattern(regexp = "^1[3-9]\\d{9}$", message = "手机号格式不正确", groups = {AddGroup.class,UpdateGroup.class})
    private String userMobile;
    @NotBlank(message = "手机号不能为空", groups = {AddGroup.class, UpdateGroup.class})
    private String userEmail;
    @NotBlank(message = "手机号不能为空", groups = {AddGroup.class, UpdateGroup.class})
    private Integer userGender;
    @NotBlank(message = "验证码不能为空", groups = {AddGroup.class, FindGroup.class})
    private String code;
    //调用接口的认证code,只有超级管理员知道
    @NotBlank(message = "认证码不能为空", groups = {AddGroup.class})
    private String authCode;
}